# -*-coding:utf-8-*-

from PyQt5.QtWidgets import QMessageBox

""" 封装弹窗代码"""


class DialogToInfo(QMessageBox):
    def MegBox(self, parent=None, title="提示", text="", info="", detail="", type=None):
        super().__init__(parent)
        self.setWindowTitle(title)
        self.setText(text)
        self.setInformativeText(info)
        self.setDetailedText(detail)
        self.setIcon(type)
        self.exec_()

    def Error(self, parent=None, title="错误", text="", info="具体信息请查看日志", detail=""):
        """ 错误弹窗"""
        self.MegBox(parent, title, text, info, detail, QMessageBox.Critical)

    def Info(self, parent=None, title="提示", text="", info="", detail=""):
        """ 信息弹窗"""
        self.MegBox(parent, title, text, info, detail, QMessageBox.Information)
